// item.cc

#include "item.h"

//Default constructor;
Item::Item(){
  _itemId = 0;
  _aisle = 0;
  _price = 0.0;
  _quantity = 1;
}

//initializes the item
Item::Item(int i, int a, double p, int q){
  _itemId = i;
  _aisle = a;
  _price = p;
  _quantity = q;
}

//Set item vars. Used with arrays
void Item::set(int i, int a, double p, int q){
  _itemId = i;
  _aisle = a;
  _price = p;
  _quantity = q;
}

//Copy constructor
Item::Item(const Item &itemSource){
  _itemId = itemSource._itemId;
  _aisle = itemSource._aisle;
  _price = itemSource._price;
  _quantity = itemSource._quantity;
}

//Asignment opperator
Item& Item::operator= (const Item &itemSource){
    //do the copy
    _itemId = itemSource._itemId;
    _aisle = itemSource._aisle;
    _price = itemSource._price;
    _quantity = itemSource._quantity;
    //return the existing object
    return *this;
}
//Return the item id of the item which is also the index in the golbal array
int Item::getItemId(){
  return _itemId;
}
//Returns the aisle number for the item
int Item::getAisle(){
  return _aisle;
}

//Returns the price of the item
double Item::getPrice(){
  return _price;
}

int Item::getQuantity() {
	return _quantity;
}

void Item::IncreaseQuantity() {
	_quantity ++;
}

void Item::DecreaseQuantity() {
	_quantity --;
}
